<template>
  <div class="box">
    <h3>my name is {{ name }}</h3>
    <h3>my age is {{ age }}</h3>
    <h3>my tel phone is {{ tel }}</h3>
    <hr>
    <h3>this is the {{ car.name }}</h3>
    <h3>it is the {{ car.price }} hundred thousand RMB</h3>
    <button @click="changeCar">change the car</button>
  </div>
</template>

<script lang="ts" name="Person" setup>
import { ref, reactive } from 'vue'
let name = ref('zhangsan')
let age = ref(23)
let tel = ref('18333333333')
let car = reactive({
  name: 'bmw',
  price: 100,
})

function changeCar() {
  Object.assign(car, { name: 'xiaomi', price: 66 })
}
</script>

<style>
.box {
  background-color: #ddd;
  border-radius: 10px;
  border: 1px #fff;
}
</style>
